/****************************************************************************

 XDV Game Engine
 Copyright 2013 - Xavier Durand-Hollis, David Ward, Vitor Makoto Matayoshi
 
 XDVTransform.h - Created Jun 11, 2013 by Xavier

 ****************************************************************************/

#ifndef XDVTRANSFORM_H_
#define XDVTRANSFORM_H_

#include "XDVComponent.h"
#include "../../Math/XDVVector3.h"
/*
 *	Client code will not have direct access to the position vector stored in a
 *	transform. Only a copy (allocated to the stack?) of the position is provided to the client.
 *
 *	Setting the position of a transform will only copy the X,Y, and Z components of the vector
 *	over to the transform's position vector.
 *
 */
class XDVTransform: public XDVComponent
{
public:
	XDVTransform(); // preset name
	XDVTransform(XDVVector3& position);
	XDVTransform(std::string name); // custom name
	XDVTransform(std::string name, XDVVector3& position);
	virtual ~XDVTransform();

	const XDVVector3& GetUp(){ return *(new XDVVector3(0,m_position->y,0)); }
	const XDVVector3& GetLeft(){ return *(new XDVVector3(m_position->x,0,0)); }
	const XDVVector3& GetForward(){ return *(new XDVVector3(0,0,m_position->z)); }

	void SetPosition(XDVVector3& position);
	void SetPosition(float x, float y, float z);

	// Gives a copy of the position vector
	XDVVector3 GetPosition();

private:
	XDVVector3* m_position;
};

#endif /* XDVTRANSFORM_H_ */
